package com.sptpc.hello.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

//Restful请求
//http get/post
//新建 post /url/ json post /drink/ {"name":"奶茶","price":"8.00"}
//修改 put /url/ json put /drink/ {"id":"1","price":"10.00"}
//删除 delete /url/id delete /drink/1     (delete /drink/)
//查看 get /url/id get /drink/1     (get /drink/)

@RestController
@RequestMapping("/hello")
public class HelloController {

    @GetMapping("/")
    public String sayHi(@RequestParam("name") String name){
        return name + ", 欢迎使用spring boot";
    }
}
